<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>用户管理界面</title>
    <link rel="stylesheet" type="text/css" href="css/User_management.css"/>
</head>
<body>
<div>
    <form action="QueryUserServlet" method="post">
        用户名：
        <input type="text" name="username" value="${name}">
        <input type="submit" name="查询">
    </form>
    <br>
    <br>
    <table>
        <tr>
            <td>用户编号</td>
            <td>用户名</td>
            <td>性别</td>
            <td>电话号码</td>
            <td>地址</td>
            <td>注册时间</td>
            <td>重置密码</td>
            <td>修改信息</td>
            <td>删除用户</td>
        </tr>

        <c:forEach items="${users}" var="user">
            <tr>
                <td>${user.userid}</td>
                <td>${user.username}</td>
                <td><c:if test="${user.sex==1}">男</c:if>
                    <c:if test="${user.sex==0}">女</c:if></td>
                <td>${user.phone}</td>
                <td>${user.address}</td>
                <td>${user.createTime}</td>
                <td><a href="ResetServlet?userid=${user.userid}">密码重置</a></td>
                <td><a href="QueryUserForUpdateServlet?userid=${user.userid}">修改</a></td>
                <td><a href="DeleteUserServlet?userid=${user.userid}&name=${user.username}">删除</a></td>
            </tr>
        </c:forEach>
    </table>
    <ul>
        <c:forEach items="${pages}" var="page">
            <li>
                <a href="QueryUserServlet?current=${page.pageNo}&name=${user.username}">${page.pageNo}</a>
            </li>
        </c:forEach>

        <li>
            第${current}页/共${total}页
        </li>
    </ul>
</div>
</body>
</html>
